/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

const rules = {
  Emoji:
    '[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[A9|AE]\u3030|uA9|uAE|\u3030',
  line: '\n',
};

function normalize(regExp: string, text: string = '', value: string) {
  if (!regExp) return value;
  return value.replace(new RegExp(rules[regExp], 'g'), text);
}

export default normalize;
